﻿namespace Miao.ML
{
	public class NullableData : WinMLData, INullable
	{
		public bool isNull => value == null;

		public WinMLData value { get; set; }

		public sealed override DataType type => DataType.Nullable;

		public NullableData()
		{
		}

		public NullableData(WinMLData value)
		{
			this.value = value;
		}

		public override string ToString()
		{
			return string.Format("{0}{1}", '?', isNull ? "null" : value.ToString());
		}
	}
}
